package top.kaoshanji.p2ch18a;

import top.kaoshanji.p2ch18a.support.ExampleTask;
import top.kaoshanji.p2ch18a.support.LoopTask;

import java.util.Timer;

/**
 * 代码清单-p2ch18a-521页a：Timer死循环示例
 * author kaoshanji
 * ^_^
 * create time 2025/2/27 17:21
 */
public class EndlessLoopTimer {

    public static void main(String[] args) {

        Timer timer = new Timer();

        timer.schedule(new LoopTask(), 10);

        // 永远也没有机会执行
        timer.schedule(new ExampleTask(), 100);

    }

}
